package com.ruoyi.client.controller;

import com.ruoyi.client.pojo.vo.CategoryVo;
import com.ruoyi.client.pojo.vo.IndexCarouselVo;
import com.ruoyi.client.pojo.vo.IndexDataVo;
import com.ruoyi.client.pojo.vo.IndexProductVo;
import com.ruoyi.client.service.ICategoryService;
import com.ruoyi.client.service.IIndexService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author：HuaQP
 * @Date：2024/4/23
 */
@Anonymous  //接口允许匿名访问
@RestController
@RequestMapping("/category")
public class CategoryController extends BaseController {
    @Resource
    private ICategoryService categoryService;

    @GetMapping("/list")
    public AjaxResult index() {

        // 获取数据
        List<CategoryVo> categoryVoList = categoryService.listCategory();
        // 接口返回
        return AjaxResult.success(categoryVoList);
    }
}
